//this is domain object tester
//andycai.sc@gmail.com 2012-04-19

#ifndef GDOMAINOBJTESTER_H_INCLUDED
#define GDOMAINOBJTESTER_H_INCLUDED

#include "GDomainObject.h"
#include "GFrameTester.h"

#include <string>
using std::string;

class MessageDomain : public GDomainObject
{
public:
    MessageDomain(GDataReceiver* dataReceiver);
    ~MessageDomain();

    enum Event
    {
        MSG_CHANGE = 1
    };

    void setMessage(const string& message);

private:
    string m_message;
};

class MessageReceiver : public GDataReceiver
{
public:
    MessageReceiver();
    ~MessageReceiver();

    void setMessageDomain(MessageDomain* meDomain);

    void process(GDomainEvent* dEvent, GDomainObject* dObject);

private:
    MessageDomain* m_messageDomain;
};

class GDomainObjTester : public GFrameTester
{
public:
    GDomainObjTester(const string& testName = "GDomainObject");
    ~GDomainObjTester();

    void run();
};


#endif // GDOMAINOBJTESTER_H_INCLUDED
